from Products.CMFCore.utils import getToolByName
from Products.ExternalMethod.ExternalMethod import ExternalMethod

def installWorkflows(self, package, out):
    """
    """
    
    productname = 'PloneZopista'
    workflowTool = getToolByName(self, 'portal_workflow')
    
    ourProductWorkflow = ExternalMethod('temp',
                         'temp',
                         productname+'.'+'zopista_workflow',
                         'createzopista_workflow') 
    workflow = ourProductWorkflow(self, 'zopista_workflow')
    workflowTool._setObject('zopista_workflow', workflow)
    workflowTool.setChainForPortalTypes(['Zopista'], workflow.getId())
    
    return workflowTool
